	<div id="sidebar">

	<h2>Recent Postings</h2>
	
	<?php

	$db_id = "hewittry";
	$db_pw = "A39777266";
	$db = "hewittry";
	$hostname = "mysql-user.cse.msu.edu";
	
	$conn = new mysqli($hostname, $db_id, $db_pw, $db);
	
	$query = "SELECT * FROM VehicleForSale WHERE EXISTS (SELECT * FROM VehicleForSale ORDER BY timestamp DESC LIMIT 20) ORDER BY RAND() LIMIT 3";
	$result = $conn->query($query);
	
	while ($row = $result->fetch_assoc())
	{
	?>
		<table style="width: 300px;">
			<tr>
				<td>
					<img src="./upload/<?php echo $row['Photo']; ?>" style="float: left; width: 100px; height: 100px;" />
				</td><td>
					<strong><?php echo $row["Make"] . " " . $row["Model"] . " " . $row["VehicleYear"]; ?></strong><br />
					Price: $<?php echo $row["Price"]; ?><br />
					<a href="./viewCar.php?id=<?php echo $row["VehicleForSaleID"]; ?>">See More</a>
				</td>
			</tr>
		</table>
		<br />
		
	<?php
	}
	?>
	
	<p style="text-align: center;"><a href="searchAnnouncements.php">See All Announcements</a></p>
	
	</div>

</div>
<br class="clear" />
</div>

<div id="footer"><div class="inner">
	<p><span class="credits"><a href="postAnnouncement.php">Post Announcement</a> | <a href="searchAnnouncements.php">Search Announcements</a> | <a href="manageAccount.php">Manage Account</a><br />&copy; 2010 Hewitt, Kay, Mabin / <a href="index.php">The Transportation Station</a><br />Awww, yea.</span></p>
</div></div>

</body>
</html>
